﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Element="clr-namespace:SegmentDisplay.Common.Element">
    
    <!--Resource dictionary for SegmentElement control-->

    <!--SegmentColon-->
    <ControlTemplate x:Key="SegmentColonTemplate" TargetType="{x:Type Element:SegmentElement}">
        <Viewbox Height="{TemplateBinding Height}">
            <Grid  Width="10" Height="80" >
                <Polygon Name="BackgroundTopLeft" Points="0,0" Fill="Transparent" />
                <Polygon Name="BackgroundBottomRoght" Points="10,80" Fill="Transparent" />
                <Polygon Name="SegmentA" Points="0,20 10,20 10,30 0,30" Fill="{TemplateBinding SegmentDP}" />
                <Polygon Name="SegmentB" Points="0,60 10,60 10,50 0,50" Fill="{TemplateBinding SegmentDP}" />
            </Grid>
        </Viewbox>
    </ControlTemplate>

    <Style x:Key="SegmentColonStyle" TargetType="{x:Type Element:SegmentElement}">
        <Setter Property="Template" Value="{StaticResource SegmentColonTemplate}" />
    </Style>

    <!--SegmentDot-->
    <ControlTemplate x:Key="SegmentDotTemplate" TargetType="{x:Type Element:SegmentElement}">
        <Viewbox Height="{TemplateBinding Height}">
            <Grid  Width="10" Height="80" >
                <Polygon Name="BackgroundTopLeft" Points="0,0" Fill="Transparent" />
                <Polygon Name="BackgroundBottomRoght" Points="10,80" Fill="Transparent" />
                <Polygon Name="SegmentA" Points="0,65 10,65 10,75 0,75" Fill="{TemplateBinding SegmentDP}" />
            </Grid>
        </Viewbox>
    </ControlTemplate>

    <Style x:Key="SegmentDotStyle" TargetType="{x:Type Element:SegmentElement}" >
        <Setter Property="Template" Value="{StaticResource SegmentDotTemplate}" />
    </Style>

</ResourceDictionary>